export function getBarOptions({yData = [], name,unit}) {
    return  {
        grid:{
            top: '5%',
            left: '2%',
            right: '2%',
            bottom: '5%',
            containLabel: true
        },
        tooltip:{
            trigger: 'axis',
            axisPointer: {
                type: "shadow"
            },
            formatter: function(params) {
                return params[0].seriesName+'：   '+params[0].value+unit
            }
        },
        xAxis: {
            type: 'category',
            axisTick: { alignWithLabel:true },
            boundaryGap:true,
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
            type: 'value',
            name:"吨",
        },
        series: [
            {   name:name,
                data:yData.length? yData:[120, 200, 150, 80, 70, 110, 130],
                type: 'bar',
                barWidth: '25',
                color:"#3ba1ff"
            }
        ]
    };
}